<?php
/*
// "K2 Tools" Module by JoomlaWorks for Joomla! 1.5.x - Version 2.1
// Copyright (c) 2006 - 2009 JoomlaWorks Ltd. All rights reserved.
// Released under the GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
// More info at http://www.joomlaworks.gr and http://k2.joomlaworks.gr
// Designed and developed by the JoomlaWorks team
// *** Last update: September 9th, 2009 ***
*/

/*
// mod for K2 Extra fields Filter and Search module by Piotr Konieczny
// piotr@smartwebstudio.com
*/

// no direct access
defined('_JEXEC') or die('Restricted access');

?>

<div id="k2FilterBox<?php echo $module->id; ?>" class="k2FilterBlock <?php echo $params->get('moduleclass_sfx'); ?>">
	
	<form action="<?php echo JRoute::_('index.php?option=com_k2&view=itemlist&task=filter'); ?>" method="get">
	
		<?php $app =& JFactory::getApplication(); if (!$app->getCfg('sef')): ?>
		<input type="hidden" name="option" value="com_k2" />
		<input type="hidden" name="view" value="itemlist" />
		<input type="hidden" name="task" value="filter" />
		<?php endif; ?>
		
		<?php if ($all_langs == '1') : ?>
		<input type="hidden" name="all_langs" value="yes" />
		<?php endif; ?>
		
		<?php if ( ($restrict_category == '1') && ($catid != '0') ) : ?>
		<input type="hidden" name="catid" value="<?php echo $catid; ?>" />
		<?php endif ; ?>
		
		<?php if ($advanced == '1' ) : ?>
		<input type="hidden" name="field_id" value="<?php echo $field_id; ?>" />
		<?php endif; ?>

	<h3>
		<?php echo JText::_('Search in: ').$extra_fields_name; ?>
	</h3>
	
	<input name="searchword" type="text" <?php if (JRequest::getVar('searchword')) echo ' value="'.JRequest::getVar('searchword').'"'; ?> />
    
    <?php if ($button):?>
    <?php if ($imagebutton):?>
    <input type="image" value="<?php echo $button_text; ?>" class="button<?php echo $moduleclass_sfx;?>" src="<?php echo $img; ?>" onclick="this.form.searchword.focus();"/>
    <?php else:?>
    <input type="submit" value="<?php echo $button_text; ?>" class="button<?php echo $moduleclass_sfx; ?>" />
    <?php endif;?>
    <?php endif; ?>
  </form>
</div>
